<template>
	<view class="home-page">
		<view class="choose-game">
			<view class="choose-game-zh">
				选择游戏
			</view>
			<view class="choose-game-en">
				CHOOSE GAME
			</view>
		</view>
		<view class="games">
			<view class="game-item" v-for="(gameItem, index) in gameList" :key="index"
				@tap="gotoGames(index)">
				<image :src="gameItem.image" mode="" class="game-icon"></image>
				
				<!-- <image src="/static/img/index/icon-bg.png" mode="" class="game-icon"></image> -->
				<view class="game-text">
					<view class="game-text-zh">
						{{ gameItem.type_name }}
					</view>
					<view class="game-text-en">
						{{ gameItem.name_EN }}
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import api from "@/api/game"
	export default {
		data() {
			return {
				gameList: [
					// {
					// 	image: '/static/img/index/icon-bg.png',
					// 	name_zh: '百家乐',
					// 	name_EN: 'BACCARAT',
					// 	name_en: 'baccarat',
					// }
				],
				loginform: {},
			}


		},
		mounted() {
			this.gameinfo();
		},
		methods: {
			gameinfo() {
				api.gameType(this.loginform).then((res) => {
					this.loading = false;
					if (res.data.code == 200) {
					this.gameList=res.data.data
					} else {
						this.$tip.alert(res.data.message);
					}
				})
			},
			gotoGames(key) {
				this.$emit("setPage", key);
			}
		}
	}
</script>

<style lang="scss" scoped>
	.home-page {
		.choose-game {
			color: #edd2a3;
			width: 240rpx;
			text-align: center;
			margin: 0 auto;
			margin-top: 100rpx;

			.choose-game-zh {
				font-family: '隶书';
				font-style: oblique;
				font-size: 60rpx;
			}

			.choose-game-en {
				font-weight: 500;
				font-size: 24rpx;
			}
		}

		.games {
			width: 100%;
			height: 660rpx;
			margin-top: 72rpx;
			padding: 0 52rpx;
			display: flex;
			flex-wrap: wrap;
			justify-content: space-between;

			.game-item {
				width: 268rpx;
				height: 276rpx;
				position: relative;

				.game-icon {
					width: 100%;
					height: 66%;
				}

				.game-text {
					width: 100%;
					text-align: center;
					position: absolute;
					bottom: 10rpx;
					color: #edd2a3;

					.game-text-zh {
						font-family: '隶书';
						font-weight: 900;
						font-style: oblique;
						font-size: 80rpx;
						margin: 0 auto;
					}

					.game-text-en {}
				}
			}
		}

	}
</style>
